home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C ++ / Frameworks / MacZoop 1.6.5 / More Classes / Window Classes / ZDragDropWindow.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-02-26  |  2.0 KB  |  90 lines  |  [TEXT/CWIE]

  1. /*************************************************************************************************
  2. *
  3. *
  4. *            ObjectMacZapp        -- a standard Mac OOP application template
  5. *
  6. *
  7. *
  8. *            ZDragDropWindow.h   -- the window object with drag and drop
  9. *
  10. *
  11. *
  12. *
  13. *
  14. *            © 1996, Graham Cox
  15. *
  16. *
  17. *
  18. *
  19. *************************************************************************************************/
  20.  
  21. #pragma once
  22.  
  23. #ifndef __ZDRAGDROPWINDOW__
  24. #define    __ZDRAGDROPWINDOW__
  25.  
  26. #ifndef __ZWINDOW__
  27. #include    "ZWindow.h"
  28. #endif
  29.  
  30. #include    <drag.h>
  31.  
  32.  
  33.  
  34. class    ZDragDropWindow    : public ZWindow
  35. {
  36. public:
  37.  
  38.     ZDragDropWindow(ZCommander* aBoss, const short windowID);
  39.     virtual ~ZDragDropWindow();
  40.     
  41.     virtual void        InitZWindow();
  42.     
  43.     virtual void        Drag( const Point startPt );
  44.     virtual void        Drop( const OSType flavour, const Ptr data, const long dataSize );
  45.     virtual void        DragHilite( const Boolean state, const DragReference theDrag );
  46.     virtual Boolean        AcceptsFlavour( const OSType aFlavour );
  47.     virtual RgnHandle    MakeDragRgn();
  48.     virtual void        MakeDragData( const DragReference theDrag );
  49.     
  50. // lowest level handlers
  51.  
  52.     virtual void        TrackTheDrag( const DragTrackingMessage theMessage, const DragReference theDrag);
  53.     virtual void        DropHandler( const DragReference theDrag );
  54.  
  55. protected:
  56.     
  57.     // installers
  58.     
  59.     virtual void        InstallDragHandlers();
  60.     virtual void        RemoveDragHandlers();
  61.     
  62.     // tracking handler methods
  63.     
  64.     virtual void        EnteredHandler( const DragReference theDrag);
  65.     virtual void        EnteredWindow( const DragReference theDrag);
  66.     virtual void        InWindow( const DragReference theDrag);
  67.     virtual void        LeftWindow( const DragReference theDrag);
  68.     virtual void        LeftHandler( const DragReference theDrag);
  69.     
  70.     // set by TrackTheDrag while it is in progress:
  71.     
  72.     DragReference        curDragRef;
  73. };
  74.  
  75.  
  76.  
  77. Boolean        MacHasDM();
  78.  
  79. /*
  80.  
  81. This window does everything that ZWindow does, but in addition supports drag and drop, if the
  82. Mac it is running on has the drag manager installed. You can override methods Drop() and Drag()
  83. to implement specific data types
  84.  
  85. */
  86.  
  87.  
  88.  
  89.  
  90. #endif